<?php
namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redis;

class Banner extends Model
{
	protected $table = 'banner';
	protected $primaryKey = 'id';
	public $timestamps = false;
	
	
	/**
	 * 获取管理员信息
	 * 
	 * @author wudi
	 */
	public static function get_banner($p=[]){
		$rs = Cache::get('banner');
		if($rs === false){
			$rs = DB::table('banner')->orderBy('pos','desc')->get()->toArray();
			Cache::set('banner', $rs,30);
		}
		return $rs;
	}
}